﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Collections.Generic;
using Newtonsoft.Json;
//using Ccit.OA.UserControls;
using Ccit.Utils;

namespace Ccit.OA.Scheduler
{
    public partial class scheduler_schview_tree : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.Page.IsPostBack)
            {
                _hidSelTab.Value = "organ";
                lbDate.Value = System.DateTime.Now.ToString("yyyy-MM-dd").Trim();
                ViewState["TABID"] = (null != Request.QueryString["TABID"]) ? Request.QueryString["TABID"].ToString() : "1";
            }
        }

        public void initPage()
        { 
            LoginUser loginUser = Session["LogUserInfo"] as LoginUser;
            hidUserId.Value = loginUser.UserId;
        }

        protected void Calendar1_SelectionChanged(object sender, EventArgs e)
        {
            string TABID = ViewState["TABID"].ToString().Trim();
            lbDate.Value = Calendar1.SelectedDate.Date.ToString("yyyy-MM-dd").Trim();
            string sParam = "TABID=" + TABID+ "&sDeptId=" + hidDeptId.Value + "&sUserId=" + hidUserId.Value.Trim() + "&RangeType=DAY&sQsrq=" + lbDate.Value + "&sJzrq=" + lbDate.Value;

            string encodeparam = Base64Lib.Encode(sParam);
            ScriptManager.RegisterStartupScript(this.updatePanel, this.GetType(), "updateScript", "doSeach('" + encodeparam + "')", true);
        }
    }
}
